﻿//-----------------------------------------------------------------------
// <summary>
//  A module in Prism is a logical unit in your application.
// </summary>
// <copyright file="NewsController.cs" company="DSSoftLogic">
//     Copyright@ DSSoftLogic 2011, Non-Commercial. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace Property.Silverlight.Module.Controllers
{
    using System;
    using System.ComponentModel.Composition;
    using Property.Silverlight.ViewModelEx;

    /// <summary>
    /// This NewsController is testing the StyleCop rules and how to use them.
    /// </summary>
    [Export(typeof(INewsController))]
    [PartCreationPolicy(CreationPolicy.Shared)]
    public class NewsController : INewsController
    {
        /// <summary>
        /// private readonly field articleViewModel.
        /// </summary>
        private readonly NewsArticleViewModel articleViewModel;
        ////private readonly NewsReaderViewModel newsReaderViewModel;

        /// <summary>
        /// Initializes a new instance of the <see cref="NewsController"/> class.
        /// </summary>
        /// <param name="articleViewModel">
        /// The article View Model.
        /// </param>
        [ImportingConstructor]
        public NewsController(NewsArticleViewModel articleViewModel)
        {
            this.articleViewModel = articleViewModel;
            if (this.articleViewModel != null)
            {
                this.articleViewModel.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(this.articleViewModel_PropertyChanged);
            }
        }

        /// <summary>
        /// The article view model_ property changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        /// <exception cref="NotImplementedException">
        /// </exception>
        private void articleViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
                case "SelectedArticle":
                    break;
            }
        }
    }
}
